function checkDate(date) {
	currentMonth = new Date().getMonth() + 1
	re = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
	regex = '\/ | \-';

	if (date.value != '') {
		if (regs = date.value.match(re)) {
			console.log(typeof regs[0]);
			regs1 = regs[0].split("/");
			console.log(regs1)
			// day value between 1 and 31
			if (regs1[0] < 1 || regs1[0] > 31) {
				alert("Invalid value for day: " + regs1[0]);
				date.focus();
				return false;
			}
			// month value between 1 and 12
			if (regs1[1] < 1 || regs1[1] > 12) {
				alert("Invalid value for month: " + regs1[1]);
				date.focus();
				return false;
			}
			console.log(new Date().getMonth())
			console.log(regs1[1])
			console.log(regs1[1] - 1 < new Date().getMonth())
			// year value between 1902 and 2012
			if (regs1[2] < new Date().getFullYear()
					|| regs1[2] == new Date().getFullYear()
					&& regs1[1] - 1 < new Date().getMonth()
					|| regs1[2] == new Date().getFullYear()
					&& regs1[1]-1 == new Date().getMonth()
					&& regs1[0] < new Date().getDate()) {
				alert("Invalid date: " + regs + "\nThe date must be at least "
						+ new Date().getDate()+"/"+ currentMonth + "/"+new Date().getFullYear());

				// alert("Invalid value for year: " + regs1[2] + " - must be at
				// least in " + (new Date()).getFullYear());
				date.focus();
				return false;
			}
		} else {
			alert("Invalid date format: " + date.value);
			date.focus();
			return false;
		}
	}
}